<?php
/* @var $this SiteController */
/* @var $model LoginForm */
/* @var $form CActiveForm  */

$this->pageTitle=Yii::app()->name . ' - Login';
$this->breadcrumbs=array(
	'Login',
);
?>
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'login-form',
	'enableClientValidation'=>true,
	'clientOptions'=>array(
    'validateOnSubmit'=>true,
	),
)); ?>
<!-- container -->
<div class="container">

	<ol class="breadcrumb">
		<li><?php echo CHtml::link('首页', array('/site/index'));?></li>
		<li class="active"><?php echo CHtml::link('用户', array('/site/login'));?></li>
	</ol>

	<div class="row">

		<!-- Article main content -->
		<article class="col-xs-12 maincontent">
			<header class="page-header">
				<h1 class="page-title">登陆</h1>
			</header>

			<div class="col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2">
				<div class="panel panel-default">
					<div class="panel-body">
                        <?php if(Yii::app()->user->hasFlash('success')):?>
                            <h3 style="color:green" class="thin text-center"><?php echo Yii::app()->user->getFlash('success'); ?></h3>
                        <?php endif; ?>
						<h3 class="thin text-center">欢迎回来图书系统</h3>
						<p class="text-center text-muted">请登陆, 如果没有账户请<?php echo CHtml::link('注册', array('/site/register'));?></p>
						<hr>

						<form>
							<div class="top-margin">
                            	<?php echo $form->labelEx($model,'用户名*', array('class'=>'text-danger')); ?>
                            	<?php echo $form->textField($model,'username', array('class'=>'form-control')); ?>
                            	<?php echo $form->error($model,'username'); ?>
							</div>
							<div class="top-margin">
                            	<?php echo $form->labelEx($model,'密码*', array('class'=>'text-danger')); ?>
                            	<?php echo $form->textField($model,'password', array('class'=>'form-control')); ?>
                            	<?php echo $form->error($model,'password'); ?>
							</div>

							<div class="top-margin">
                                <?php $this->widget('CCaptcha',array(
                                    'buttonLabel'=>'刷新验证码',
                                ));?>
                                <?php echo $form->textField($model,'verifyCode', array('class'=>'form-control')); ?>
                                <?php echo $form->error($model,'verifyCode'); ?>
							</div>

	                        <div class="top-margin">
	                        	<?php echo $form->checkBox($model,'rememberMe'); ?>
	                        	<?php echo $form->label($model,'记住我'); ?>
	                        	<?php echo $form->error($model,'rememberMe'); ?>
	                        </div>
							<hr>

							<div class="row">
								<div class="col-lg-8">
                                <!--
									<b><a href="">忘记密码</a></b>
                                -->
								</div>
								<div class="col-lg-4 text-right">
                                    <?php echo CHtml::submitButton('登陆', array('class'=>'btn btn-action')); ?>
								</div>
							</div>
						</form>
					</div>
				</div>

			</div>

		</article>
		<!-- /Article -->

	</div>
</div>	<!-- /container -->
<?php $this->endWidget(); ?>
</div><!-- form -->
